﻿using System;
using System.Web.UI.WebControls;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain.Products;

namespace Ue.Qcdz.UI.Controls.Products
{
    public class ProductManger : SkinnedGridView
    {
        private string skinFileName = "~/Admin/Themes/Skins/Products/ProductManger.ascx";
        #region Overrides of SkinnedControl

        protected override string GetSkinFileName()
        {
            return skinFileName;
        }

        #endregion

        #region Overrides of SkinnedGridView

        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            IDataResult<Product> dataResult = ProductService.GetProduct(this);
            Repeater repeater = sender as Repeater;
            repeater.DataSource = dataResult.DataObjects;
            repeater.DataBind();
            this.RecordCount = dataResult.RecordCount;
        }

        #endregion
    }
}